package com.lwm.mybatis.custom.sqlsession.defaults;

import com.lwm.mybatis.custom.cfg.Configuration;
import com.lwm.mybatis.custom.sqlsession.SqlSession;
import com.lwm.mybatis.custom.sqlsession.SqlSessionFactory;

/**
 * SqlSessionFactory 默认实现类
 *
 * @author liweimin
 * @date 2021/6/15 18:03
 * @see com.lwm.mybatis.custom.sqlsession.SqlSessionFactory
 * @since
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory {

    private Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }

    @Override
    public SqlSession openSession() {
        return new DefaultSqlSession(configuration);
    }
}
